package com.example.zhaohang.utils;

import java.io.IOException;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class HttpUtil {

	//get请求
	public static Response HttpGet(String url) throws IOException{
		 // 01. 定义okhttp
	    OkHttpClient okHttpClient_get = new OkHttpClient();
	    // 02.请求体
	    Request request = new Request.Builder()
	        .get()//get请求方式
	        .url(url)//网址
	        .build();
	        
	    // 03.执行okhttp
	    
	    Response response = okHttpClient_get.newCall(request).execute();
	    return response;
	}
}
